package com.lly.songhigh.adapter;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.util.Log;


import com.lly.songhigh.fragment.SingleFragment;

import java.util.ArrayList;

/**
 * Created by dllo on 15/9/22.
 */
public class SingerDetailActivityAdapter extends FragmentPagerAdapter {

    private ArrayList<Fragment> datas;
    private String[] titles = {"单曲", "专辑", "MV", "歌手信息"};

    public SingerDetailActivityAdapter(FragmentManager fm, ArrayList<Fragment> datas) {
        super(fm);
        this.datas = datas;
//        initData();

    }
    private void initData() {
        datas = new ArrayList<>();
        datas.add(new SingleFragment());
        datas.add(new SingleFragment());
        datas.add(new SingleFragment());
        datas.add(new SingleFragment());

    }

    @Override
    public Fragment getItem(int position) {
        return datas.get(position);
    }

    @Override
    public int getCount() {
        return titles.length;
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return titles[position];
    }
}


